import React from 'react';
import NoAccess from '@/pages/NoAccess';

const auth = (props) => {
  if (
    props.location.pathname === '/login' ||
    props.location.pathname === '/' ||
    ~props.location.pathname.indexOf('/automated')
  ) {
    return <div> {props.children} </div>;
  } else {
    return (
      <div>
        <NoAccess />
      </div>
    );
  }
};

export default auth;
